package com.zzedu.common.enums;

import java.util.Arrays;

/**
 * 登录平台
 * @author wyf
 */
public enum PlatformLoginEnumns {


    PC(1, "PC"),

    WEB_APP(2, "WEB_APP"),

    ;

    PlatformLoginEnumns(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;

    private String desc;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static PlatformLoginEnumns getCode(int code) {
        return Arrays.stream(PlatformLoginEnumns.values()).filter(e -> e.getCode() == code).findFirst().orElse(null);
    }
}
